package com.hornsun.data.constant.types;

/**
 * <p>
 * 该文件的作用：//TODO
 * </p>
 *
 * @author xuxin
 * @date 2018/8/29
 */
public enum StatusEnum {
    SUCCESS(0,"成功"),
    ERROR(1,"失败");

    private Integer code;
    private String content;

    StatusEnum(Integer code ,String content){this.code=code;this.content=content;}

    public Integer getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }

    public static StatusEnum authErrorByContent(String content) {
        for (StatusEnum statusEnum : values()) {
            if (statusEnum.content.equals(content)){
                return statusEnum;
            }
        }
        return null;
    }
}
